package ltd;

import java.util.Arrays;

/**
 * @author : FHM
 * @data : 2021/9/2 - 18:11
 */
public class Test01 {
    public int[] twoSum(int[] nums,int target) {
        int arr[] = new int[2] ;
        for(int i = 0 ; i<nums.length ; i++){
            for(int j = i+1 ; j<nums.length ; j++){
                if( (nums[i]+nums[j])==target ){
                    arr[0] = i ;
                    arr[1] = j ;
                }

            }
        }
        return arr ;

    }

    public static void main(String[] args){
        int arr1[] = {2,7,11,15} ;
        int target = 9;
        Test01 solution = new Test01();
        int[] ints = solution.twoSum(arr1,target);
        System.out.println(Arrays.toString(ints));

    }


}
